﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UIT.Animations;
using System.Windows.Markup;
using UIT.Controls.Containers;
using UIT.Controls;

namespace UIT.VisualStates
{
    [ContentProperty("Style")]
    public class VisualState : IContainable<IControl>, IDisposable
    {
        public string Name { get; set; }

        private StoryBoard enter;

        public StoryBoard Enter
        {
            get { return enter; }
            set
            {
                enter = value;
                if (enter.Target != null)
                    enter.Target = Parent;
            }
        }

        private StoryBoard exit;

        public StoryBoard Exit
        {
            get { return exit; }
            set
            {
                exit = value;
                if (exit.Target != null)
                    exit.Target = Parent;
            }
        }


        public Style.Style Style { get; set; }

        private IControl parent;

        public IControl Parent
        {
            get { return parent; }
            set
            {
                parent = value;
                if (enter.Target == null)
                    enter.Target = parent;
                if (exit.Target == null)
                    exit.Target = parent;
            }
        }



        public void Dispose()
        {
        }
    }
}
